package com.bing.bingPro.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bing.bingPro.controller.dto.TFiveOrderTypeDto;
import com.bing.bingPro.controller.vo.TCpOrderVo;
import com.bing.bingPro.entity.TCpOrder;
import com.bing.bingPro.mapper.TCpOrderMapper;
import com.bing.bingPro.service.TCpOrderService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author qilong
 * @description 针对表【t_cp_order】的数据库操作Service实现
 * @createDate
 */
@Service
public class TCpOrderServiceImpl extends ServiceImpl<TCpOrderMapper, TCpOrder>
        implements TCpOrderService {

    @Override
    public List<TCpOrderVo> cpList(TFiveOrderTypeDto tOrderYearDto) {
        return null;
    }

    @Override
    public List<TCpOrderVo> exportCp(TFiveOrderTypeDto tOrderYearDto) {
        List<TCpOrderVo> tCpOrderVos = this.cpList(tOrderYearDto);
        return tCpOrderVos.stream()
                .map(tCpOrderVo -> {
                    TCpOrderVo vo = new TCpOrderVo();
                    BeanUtil.copyProperties(tCpOrderVo, vo);
                    return vo;
                })
                .collect(Collectors.toList());
    }
}




